1. Field of the Invention
This invention pertains to a queue control apparatus for use in exchanging data between a data generating side and a data using side.
2. Description of the Related Arts
A queue is used for absorbing a difference in a process timing between a data generating side (a data generating apparatus) and a data using side processing data (a data processing apparatus). The data may be a message, a packet, a job, a transaction and so forth. A queue is generally composed of, for example, a FIFO (First-In, First-Out) memory forming a FIFO buffer. A data generating device puts generated data into a queue, and a data processing device takes the data out of the queue for executing a predetermined process.
A queue has a storage capacity sufficient for storing a plurality of packets. This allows a data processing device to take out from a queue one data block at a time for a sequential data processing in accordance with its own processing capability. In addition, having a plurality of a data generating device share a single queue enables a single data processing device to receive a data processing request from the plurality of data generating devices. Further, always putting generated data immediately into a queue, as long as the queue has an available space, allows each of the plurality of data generating devices to start the next processing, promptly thus ensuring an efficient operation.
However, a conventional queue control apparatus has the following disadvantages:
1. Firstly, because a queue has a limit on its data capacity, when a queue becomes full, (i.e. when a queue does not have an available space), a side supplying a data block into the queue, (i.e. a data generating device), must stand by before supplying the next data set until the queue has an available space. The necessity for a data generating device to stand by idle for an available space in a queue lowers its processing efficiency.
2. Secondly, when a data processing device, (such as one processing a series of data columns as a packet), is connected to the output side of a queue, the queue cannot complete the processing of the packet until the data generating device supplies all data in a packet. That is, until a data generating device supplies all data in a packet to a queue, a data processing device must suspend its processing. Hence, in such a case, unless a packet is taken out of a queue after a data generating device has supplied all data in a packet, the packet processing device experiences an idle time, which lowers its processing efficiency.
3. Thirdly, a packet processing may occasionally require previously supplied data to be removed from a queue while a data generating device supplies packet data. However, when a data processing device has already started to process a packet by taking data already supplied to a queue, out from the queue, it is impossible to remove such already supplied data. Hence, in such a case, the data processing device has no choice but to discard the packet data. Such a situation occurs e.g. in a system where a data generating device comprises a processor for executing a plurality of programs (processes) and each of the processes individually generates a packet to be written into a shared queue. That is, the system experiences this situation when another process obtains an execution right, while a process writes packet data into the shared queue, and this newly scheduled process makes an attempt to write into the shared queue packet data it generates.